package com.ley.yikang.service.serviceimpl;

import com.ley.yikang.entity.Action;
import com.ley.yikang.mapper.ActionMapper;
import com.ley.yikang.service.ActionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActionServiceImpl implements ActionService {
    final
    ActionMapper actionMapper;

    @Autowired
    public ActionServiceImpl(ActionMapper actionMapper) {
        this.actionMapper = actionMapper;
    }

    @Override
    public void addAction(Action action) {
        actionMapper.addAction(action);
    }

    @Override
    public List<Action> getActionByCommunityId(int CommunityId) {
        return actionMapper.getActionByCommunityId(CommunityId);
    }

    @Override
    public void delActionByCommunityId(int CommunityId) {
        actionMapper.delActionByCommunityId(CommunityId);
    }

    @Override
    public Action getActionById(int id) {
        return actionMapper.getActionById(id);
    }

    @Override
    public void delAction(int id) {
        actionMapper.delAction(id);
    }

    @Override
    public void updateAction(Action action) {
        actionMapper.updateAction(action);
    }
}
